#include<iostream>
#include<string>
#include<cmath>
class Point
{
    public:
        Point():x(0),y(0) {}
        Point(int x, int y) : x(x), y(y) {}
        void show()
        {
            std::cout << "(" << x <<","<<y<< ")" << std::endl;
        }
        //友元函数声明 可以调用私有权限的成员,如果一个类中友元声明过多，会显得臃肿
        // friend double Distance(const Point &p1, const Point &p2);
        //声明友元类
        friend class Tool;
    private:
        int x;
        int y;
};
//工具类
class Tool
{
    public:
    static double Distance(const Point &p1, const Point &p2)
{
    return std::sqrt(std::pow((p1.x-p2.x),2)+std::pow((p1.y-p2.y),2));
}
};

int main()
{
    Point p1;
    p1.show();
    Point p2(1, 2);
    p2.show();
    std::cout << Tool::Distance(p1, p2) << std::endl;
    return 0;
}